import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";
import AutoImport from "unplugin-auto-import/vite";
import { error, warn } from "console";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), AutoImport({ imports: ["vue", "vue-router"] })],
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "./src"), // 配置别名 '@' 指向 '/src' 目录
    },
  },
  server: {
    port: 5252,
    open: true,
    proxy: {
      "/node": {
        target: "http://10.0.52.19:3061/",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/node/, ''),
      },
    },
  },
});
